srcs := $(wildcard *.c)
objects := $(patsubst %.c,%.o,$(srcs))
outputs := $(patsubst %.c,%,$(srcs))

all: $(outputs)

# $(outputs): %: $(srcs)
# 	$(CC) $(CFLAGS) $< -o $@

$(outputs): %: $(objects)
	echo 111 $(CC) $@ $<
	$(CC) $(CFLAGS) $< -o $@
	
$(objects): %.o: $(srcs)
	echo 222 $(CC) $@ $<
	$(CC) -c $(CFLAGS) $< -o $@

	
.PHONY: clean
.PHONY: debug
debug: 
	echo srcs: $(srcs)
	echo objects: $(objects)
	echo outputs: $(outputs)
	echo $$$$ $$$$
	echo $$$$ $$$$
clean:
	echo $(CC) $@ $<
	rm -rf *.o
	rm -rf a.out
	rm -rf $(outputs)

	